<template>
  <div>
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
       class="table_header_blue"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      @change="handleTableChange"
    >
      <span slot="matter" slot-scope="text">
        <j-ellipsis :value="text" :length="15"/>
      </span>
      <span slot="accord" slot-scope="text">
        <j-ellipsis :value="text" :length="15"/>
      </span>
      <span slot="proName" slot-scope="text">
        <j-ellipsis :value="proName" :length="15" />
      </span>
      <span slot="action" slot-scope="text, record">
<!--        <a-popconfirm title="是否确认?" :disabled="zbStage === '06010'? true : record.isque === 2" @confirm="() => handleOK(record)">
            <a-button :disabled="zbStage === '06010'? true : record.isque === 2" type="link">{{record.isque === 2?'已确认':'确认'}}</a-button>
        </a-popconfirm>-->
        <a-button type="link" @click="handleCheck(record,'查看')">查看</a-button>
      </span>
    </a-table>
    <QzModel ref="modalForm" :id="id" :bsjdwName="bsjdwName" :bsjdw="bsjdw" :protype="protype" :type="type"
             @ok="modalFormOk"></QzModel>
  </div>
</template>

<script>
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import columns from './indexColumns'
  import CheckAndEditModel from './CheckAndEditModel'
  import {httpAction} from '@/api/manage'
  import QzModel from '@views/sj/sjxmzygl/commView/sssj/sjyd/QzModel.vue'

  export default {
    props: ['id', 'bsjdwName', 'bsjdw', 'protype', 'type','zbStage','proName'],
    name: "sjqz",
    components: {
      QzModel,
      CheckAndEditModel
    },
    mixins: [JeecgListMixin],
    watch: {
      'queryParam.sstype': {
        handler: function (val) {
          this.loadData()
        },
        immediate: true,
        deep: true
      }
    },
    data() {
      return {
        //表头
        queryParam: {
          proId: this.id
        },
        columns: columns(this),
        url: {
          list: '/sjxmzygl/sjWorkZtfaEvidence/list',
          // delete: '/sjxmzygl/sjWorkZtfaMatter/remove',
          exportList: `${window._CONFIG['domianURL']}/sjxmzygl/sjWorkZtfaMatter/exportMatterInfo`,
        }
      }
    },
    methods: {
      handleOK(record) {
        httpAction('/sjxmzygl/sjWorkZtfaMatter/updMatterBatchQr', {ids: record.id}, 'put').then((res) => {
          if (res.success) {
            this.$message.success(res.message)
            this.loadData()
          } else {
            this.$message.error(res.message)
          }
        })
      },
    }
  }
</script>

<style lang="less" scoped>
@import '~@assets/less/tableTheme.less';

</style>